<template>
    <a-modal 
    class="my-modal short" 
    v-model:visible="modal_show" 
    title="输入名称" 
    @ok="modelok" 
    width="50%" 
    :maskClosable="false" 
    :centered="true"
    :destroyOnClose="true"
    :zIndex="1010"
    >
        <div class="body-content" >
            <a-input size="small" placeholder="" v-model:value="dir" />
        </div>
    </a-modal>
</template>
<script>
export default {
    components: {},
    data() {
        return {
            modal_show: false,
            dir:"",

            //
            mitt_input_name_id:"",
            mitt_input_name_back_id:"",

        };
    },
    beforeUnmount() {
        this.$mitt.off('mitt_input_name_id',this.mitt_input_name_id);
    },
    mounted() { 
        this.mitt_input_name_id=this.$mitt.on('input_name',(uid,_options)  => {
            this.mitt_input_name_back_id=uid
            this.dir = "";
            this.modal_show = true;
        });
    },
    methods: {
        async modelok() {
            this.$mitt.oemit('input_name_back',this.dir,this?.mitt_input_name_back_id);
            this.modal_show = false;
        },
    },
};
</script>